home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Purity / Purity #21 (1994-01-12)(Diesel)(DE)[WB].zip / Purity #21 (1994-01-12)(Diesel)(DE)[WB].adf / ModToPas / txt / KonTest.pas < prev    next >
Pascal/Delphi Source File  |  1993-12-13  |  2KB  |  89 lines

  1. (**********************************************************************
  2.  
  3.     :Program.    KonTest.mod
  4.     :Contents.   Testet einige TP-Module und ModToPas
  5.     :Author.     Markus Uhlendahl
  6.     :Address.    Vorm Burgtor 16, D-4408 Dülmen
  7.     :Phone.      02594/81540
  8.     :Copyright.  Public Domain
  9.     :Language.   Modula-2
  10.     :Translator. M2Amiga AMSoft V3.3d
  11.  
  12. **********************************************************************)
  13. PROGRAM KonTest;
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23. VAR r,a,b : REAL;
  24.     x,y,i : INTEGER;
  25.     f     : Datei;
  26.     s     : ARRAY[0..20] OF CHAR;
  27.     c     : CHAR;
  28.     p     :  ^INTEGER;
  29.  
  30.  
  31. BEGIN
  32.   ClrScr;
  33.   r:=0.0;
  34.   WHILE (r<6.28) DO BEGIN
  35.     a:=40.0+Sin (r)*40.0;
  36.     b:=14.0+Cos (r)*12.0;
  37.     x:=INTEGER(a);
  38.     y:=INTEGER(b);
  39.     Gotoxy (x,y);
  40.     Write ('*');
  41.     r:=r+0.05;
  42.     Gotoxy (1,1);
  43.     Write (a:10:2);a:=Frac(a);Write (a:10:2);
  44.   END;
  45.   Gotoxy (1,1);
  46.   FOR i:=1 TO 20 DO BEGIN
  47.     DelLine;
  48.     InsLine;
  49.   END;
  50.   ClrScr;
  51.   Write ('Speichere Zahlen auf Datei ...');WriteLn;
  52.   Assign (f,"ram:test");
  53.   Rewrite (f);
  54.   FOR i:=1 TO 5 DO BEGIN
  55.     Write (f,3.5);
  56.     Write (f,´Harald´);
  57.     Write (f,"p");
  58.     Write (f,2343);
  59.   END;
  60.   Close (f);
  61.   Write ('Lese Zahlen von Datei ...');WriteLn;
  62.   Assign (f,"ram:test"); (* hier Filenamen ändern *)
  63.   Reset (f);
  64.   FOR i:=1 TO 5 DO BEGIN
  65.     Read (f,r);
  66.     r:=Round (r); (* Fehlerhaft ? *)
  67.     Write (r:10:2);WriteLn;
  68.     Read (f,s);
  69.     Write (s);WriteLn;
  70.     Read (f,c);
  71.     Write (c);WriteLn;
  72.     Read (f,x);
  73.     Write (x:10);WriteLn;
  74.   END;
  75.   Close (f);
  76.   New (p);
  77.   p^:=34;
  78.   Write (p^:10);WriteLn;
  79.   Dispose (p);
  80.   x:=MemAvail ();
  81.   Write (x:10);WriteLn;
  82.   y:=256;
  83.   y:=Hi (y);
  84.   x:=256;
  85.   x:=Lo (x);
  86.   Write (x:5);WriteLn;
  87.   Write (y:5);WriteLn;
  88. END.
  89.